package cn.tedu.charging.order.feign;

import cn.tedu.charging.common.pojo.JsonResult;
import cn.tedu.charging.common.pojo.param.ChargingProcessParam;
import cn.tedu.charging.common.pojo.vo.ChargingProcessVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 订单用来访问计价服务的客户端
 */
//userService是服务名称，要和在nacos中注册的服务名称相同，要调用谁，就写谁
@FeignClient(name = "costService")
public interface CostClient {

    /**
     * 调用计价服务计算电费
     * @param chargingProcessParam
     * @return
     */
    @PostMapping("/cost/calculate")
    JsonResult<ChargingProcessVO> calculateCost(@RequestBody ChargingProcessParam chargingProcessParam);
}
